<?php
class CargarHelper extends AppHelper 
{
	var $helpers = array('Html', 'Javascript', 'Form','Ajax','Session');
	var $Html = null;
	var $Javascript = null;
	var $Ajax = null;


function enlace($title, $href = null, $options = array(), $confirm = null, $escapeTitle = true)
{
	$Ajax=new AjaxHelper();
	$return=$Ajax->link($title, $href, $options, $confirm, $escapeTitle);
    
    return $return;
}
	


function link($title1,$title2, $url_cargar, $id_cargar,$pre=null)
{
    if(isset($title1) && isset($title2) && isset($url_cargar) && isset($id_cargar))
    {
		if($pre==null)
		{
	    	$return="<a href=\"#".$title1."\" onClick=\"confirmarl('$url_cargar','$id_cargar','No');\" style='text-decoration:none; color: #000000;'>".$title2."</a>";
        }
		else
		{
	    	$return="<a  href=\"#".$title1."\" onClick=\"confirmarl('$url_cargar','$id_cargar','$pre');\" style='text-decoration:none; color: #000000;'>".$title2."</a>";
        }
    }
    else
    {
		$return="";
    }
    return $return;
}
	

	function ver_fecha($f=null)
	{
		return substr($f,8,2)."-".substr($f,5,2)."-".substr($f,0,4);
	}
	function miles($numero)
	{
		return number_format($numero,2,',','.');
	}
}
?>
